import React from 'react';
import styles from './index.module.scss';
import { getEnv } from 'src/libs/utils';
import envConfig from 'src/env/env.config';
import { message } from 'antd';

const Bot = () => {

	const handleBot = () => {
		const env = getEnv();

		if ( env ) {
			window.open( envConfig[env].botUrl, '_blank' );
		} else {
			message.error( '地址不存在' );
		}
	};

	return (
		<div className={ styles.bot } onClick={() => handleBot()}>
			<img src={ require( 'src/assets/img/bot.png' ) } alt=""/>
		</div>

	);
};

export default React.memo( Bot );